#define _CRT_SECURE_NO_WARNINGS 1


#include<map>
#include<string>
#include<iostream>

using namespace std;

int main()
{
    string s;
    cin >> s;
    map<char, int> hash;
    int size = s.size();
    for (int i = size - 1; i >= 0; i--)
    {
        if (hash.count(s[i]) != 1)
        {
            hash[s[i]] = i;
            cout << s[i];
        }
    }
    cout << endl;

    return 0;
}